const fs = require('fs');

fs.rename (__dirname + '\\text.txt',__dirname + '\\text', err => {
  if (err) throw err;

  console.log('rename done!');
});
